package com.hmkj.core.mapper.commo;

import com.hmkj.common.baseMapper.GenericMapper;
import com.hmkj.core.po.commo.Commo;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
 * 交易品种表相关Dao接口<br>
 *
 * @author eproo
 * @date   2017-11-07 02:22:12
 */
public interface CommoMapper extends GenericMapper< Commo,Integer> {

    @Select("SELECT t.* FROM biz_commo t WHERE 1 = 1 ${whereSql} ${sortSql} LIMIT ${nowPage}, ${pageSize}")
    List<Commo> findListBySqlJoin(Map<String, Object> params);

    @Select("SELECT count(1)  FROM biz_commo t WHERE 1=1 ${whereSql}")
    long countBySqlJoin(Map<String, Object> params);

    @Select("SELECT count(1)  FROM biz_commo t WHERE 1=1 and t.id <> ${id} and (t.name = '${name}' or t.code = '${code}') and t.del_flag = ${delFlag}")
    int checkRepeatSql(Commo model);
}
